pacman::p_load(olsrr, sf, GWmodel, tmap, tidyverse, ggstatsplot, sfdep)This was my final project for the course Geospatial Analysis. Here I looked at the information from FinscopeTanzania 2023 to model measures of financial inclusion both globally and geographically. In this project, I used geographically weighted logistics regression to see how the factors linked to financial inclusion vary across districts.
A. Getting Started
A.1 Background
The World Bank defines financial inclusion as the state of having access to useful and affordable financial products to meet one’s needs. Financial inclusion is an enabler to 7 of the Sustainable Development Goals, and is seen as the key enabler to reduce extreme poverty.
One key dimension of financial inclusion that the World Bank looked at in their latest Global Findex Database 2021 is the ownership of bank accounts for adults. In this report, 76% of the global adult population have their own accounts, but only 71% of the developing nations’ do. In some countries like Tanzania this number is even lower at 52%. Banking is just one traditional dimension. Other vehicles like mobile payments can bridge the gap in access to services for some of these nations.
Tanzania recognizes the importance of financial inclusion in promoting economic growth and with the Bank of Tanzania, the country’s central bank, the Microfinance Policy of 2000 was developed and focused on expanding financial services for low-income individuals.
The program behind financial inclusion has been structured from 2014 with the first National Financial Inclusion Framework for 2014-2016, with the latest version being the third framework for 2023-2028. While there has been significant progress, (e.g., access to financial services has risen from 42% in 2013 to 89% in 2023) the country continues to aim for inclusion for the whole population by increasing access, encouraging usage and enhancing the quality of financial services.
A.2 Objectives
Finscope Tanzania 2023 is a public-private sector collaboration and aimed, among others, to understand and describe the financial behavior of individuals in the country and to establish an updated view of the level of financial inclusion across various measures. A large part of the findings is showing the change (improvements) of the overall measures against the previous 2017 report.
The objective of this study is to build on the Finscope Tanzania 2023 by identifying influential variables and identifying if geospatial factors influence the effect of those variables.
In order to satisfy this, the specific deliverables for the study will be:
to build a global or non-spatial explanatory model for the level of financial inclusion across Tanzania;
to build a geographically weighted explanatory model for the same response variables; and,
to assess the advantage of the geographically weighted model and to analyse the geographically weighted model
A.3 Data Sources
The following data sources are used for this analysis:
Finscope Tanzania 2023 individual survey data from Finscope Tanzania
The dataset is contained in a csv and translates the responses from 9,915 individuals who answered the survey
The respondents are all adults aged 16 years and above take across Tanzania
The dataset also includes derived fields which include different indicators for financial inclusion based on different criteria
District-level boundaries in Tanzania as a shapefile from geoBoundaries.org portal
A.4 Importing and Launching R Packages
For this study, the following R packages will be used. A description of the packages and the code, using p_load() of the pacman package, to import them is given below.
The loaded packages include:
olsrr - for building OLS (ordinary least squares) regression models and performing diagnostic tests
GWmodel - for calibrating geographically weighted family of models
tmap - for plotting cartographic quality maps
ggstatsplot - for multivariate data visualization and analysis
sf - spatial data handling
tidyverse - attribute data handling
B. Data Loading and Preparation
B.1 Loading Tanzania District boundaries
We load the district level boundaries in the following code chunk using st_read() and indicating the appropriate layer name. (i.e., the level 2 map) We also use rename() to already change the shapeName field to district to make it more understandable. We also project the map onto EPSG 32737 using st_transform() in order to be able to reference distances in terms of metres.
tz_dist <- st_read(dsn="data/geospatial",
layer="geoBoundaries-TZA-ADM2") %>%
rename(district = shapeName) %>%
st_transform(32737)Reading layer `geoBoundaries-TZA-ADM2' from data source
`C:\drkrodriguez\datawithderek\posts\tz-fin-2023\data\geospatial'
using driver `ESRI Shapefile'
Simple feature collection with 170 features and 5 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 29.58953 ymin: -11.76235 xmax: 40.44473 ymax: -0.983143
Geodetic CRS: WGS 84
tz_distSimple feature collection with 170 features and 5 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: -548018.9 ymin: 8698528 xmax: 658181.6 ymax: 9890194
Projected CRS: WGS 84 / UTM zone 37S
First 10 features:
district shapeISO shapeID shapeGroup shapeType
1 Arusha <NA> 72390352B32479700182608 TZA ADM2
2 Arusha Urban <NA> 72390352B90906351205470 TZA ADM2
3 Karatu <NA> 72390352B22674606658861 TZA ADM2
4 Longido <NA> 72390352B95731720096997 TZA ADM2
5 Meru <NA> 72390352B99598192663387 TZA ADM2
6 Monduli <NA> 72390352B11439822404473 TZA ADM2
7 Ngorongoro <NA> 72390352B42279830137418 TZA ADM2
8 Ilala <NA> 72390352B40584164885098 TZA ADM2
9 Kinondoni <NA> 72390352B66429416458525 TZA ADM2
10 Temeke <NA> 72390352B94835751472469 TZA ADM2
geometry
1 MULTIPOLYGON (((262372 9603...
2 MULTIPOLYGON (((251788.2 96...
3 MULTIPOLYGON (((148006.1 96...
4 MULTIPOLYGON (((206258.1 96...
5 MULTIPOLYGON (((262372 9603...
6 MULTIPOLYGON (((226729.3 96...
7 MULTIPOLYGON (((160641.8 96...
8 MULTIPOLYGON (((530993 9249...
9 MULTIPOLYGON (((529848.2 92...
10 MULTIPOLYGON (((531400.6 92...
The output shows that there are 170 objects loaded which corresponds to individual districts. The object is also of multipolygon class which could indicate that there are districts with discontinuous land areas, like islands.
We can create a simple map to visualize the boundaries using qtm() from tmap.
tmap_mode("view")tmap mode set to interactive viewing
qtm(tz_dist, text = "district", text.size = 0.4)